package com.sise.foodplatform.service.impl;

import com.sise.foodplatform.dao.FoodMapper;
import com.sise.foodplatform.pojo.Food;
import com.sise.foodplatform.service.FoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class FoodServiceImpl implements FoodService {

    @Autowired
    private FoodMapper foodMapper;

    @Override
    public List<Food> getAllFood(String foodName, int PageStart, int pageSize) {
        return foodMapper.getAllFood(foodName,PageStart,pageSize);
    }

    @Override
    public int getFoodCounts(String foodName) {
        return foodMapper.getFoodCounts(foodName);
    }

    @Override
    public int deleteFood(int id) {
        return foodMapper.deleteFood(id);
    }

    @Override
    public int addFood(Food food) {
        return foodMapper.addFood(food);
    }

    @Override
    public Food getUpdateFood(int id) {
        return foodMapper.getUpdateFood(id);
    }

    @Override
    public int editFood(Food food) {
        return foodMapper.editFood(food);
    }

    @Override
    public List<Food> getFoodByName(String uid,int PageStart,int pageSize) {
        return foodMapper.getFoodByName(uid,PageStart,pageSize);
    }

    @Override
    public int getCountsByName(String uid) {
        return foodMapper.getCountsByName(uid);
    }


}
